<%--<%@ page import="com.lengmou.service.TypeService" %>--%>
<%--<%@ page import="com.lengmou.service.impl.TypeServiceImpl" %>--%>
<%@ page import="com.lengmou.entity.Goods" %>
<%--<%@ page import="com.lengmou.entity.Type" %>--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" trimDirectiveWhitespaces="true" errorPage="error.jsp" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="apple-mobile-web-app-title" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=1200">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="icon" href="http://masadora-js.masadora.net/static/new_masadora/images/favicon/masadora-icon.png">
    <link rel="apple-touch-icon" href="http://masadora-js.masadora.net/static/new_masadora/images/favicon/masadora-icon.png">
    <link rel="apple-touch-icon-precomposed" href="http://masadora-js.masadora.net/static/new_masadora/images/favicon/masadora-icon.png">
    <script src="js/jquery-3.1.0.js" ></script>
    <script>
        $(function () {

            $('a[action="删除搜索字段"]').click(function () {
                $("#keyword").val("");
            });
        });
    </script>
    <title>商品列表</title>
</head>

<body>


<%--插入头部--%>

<%@include file="header.jsp" %>

<div class="bg-gray">
<form method="get" action="search" class="func-list-search-box">
    <div class="ui-layout">
        <input id="keyword" type="text" name="goodsname" placeholder="请输入搜索的商品名称" autocomplete="off" autofocus="autofocus" value="${goodsname}">
        <button type="submit">搜索</button>
        <a action="删除搜索字段"></a>
    </div>
</form>
</div>
    <div class="ui-layout">
        <div class="ui-crumb-box">
            <b><a href="/">首页</a></b>
            <i></i>
            <a href=""></a>
        </div>
        <%--<div class="view-good-filter-box">--%>
            <%--<div class="filter-item-box">--%>
                <%--<b>类型</b>--%>
                <%--<c:choose>--%>
                    <%--<c:when test="${type!=null&&type.length()!=0}">--%>
                        <%--<a data-id="${type}" href="search?goodsname=${goodsname}&ud=${ud}">全部</a>--%>
                    <%--</c:when>--%>
                    <%--<c:otherwise>--%>
                        <%--<a href="#" class="active">全部</a>--%>
                    <%--</c:otherwise>--%>
                <%--</c:choose>--%>
                <%--<c:forEach items="${types}" var="t">--%>
                    <%--<c:choose>--%>
                        <%--<c:when test="${t.id==type}">--%>
                            <%--<a class="active" href="#" >${t.name}</a>--%>
                        <%--</c:when>--%>
                        <%--<c:otherwise>--%>
                            <%--<a href="search?type=${t.id}&goodsname=${goodsname}&ud=${ud}" >${t.name}</a>--%>
                        <%--</c:otherwise>--%>
                    <%--</c:choose>--%>
                <%--</c:forEach>--%>
            <%--</div>--%>
            <%--<div class="filter-item-box">--%>
                <%--<b>排序</b>--%>
                <%--<!--<a href="/product/search?size=64&sort=&categoryId=&keyword=&propertyBrand_id=&propertySeries_id=&saleStatus=&saleType=" data-sort="hot">人气</a>-->--%>
                <%--<c:if test="${ud==null||ud.length()==0}">--%>
                    <%--<a href="search?type=${type}&goodsname=${goodsname}" class="active">默认</a>--%>
                    <%--<a href="search?type=${type}&goodsname=${goodsname}&ud=2" data-sort="price">价格</a>--%>
                <%--</c:if>--%>
                <%--<c:if test="${ud!=null&&ud.length()>0&&ud eq '1'}">--%>
                    <%--<a href="search?type=${type}&goodsname=${goodsname}">默认</a>--%>
                    <%--<a href="search?type=${type}&goodsname=${goodsname}&ud=2" data-sort="price" class="active" data-sort-type="asc">价格</a>--%>
                <%--</c:if>--%>
                <%--<c:if test="${ud!=null&&ud.length()>0&&ud eq '2'}">--%>
                    <%--<a href="search?type=${type}&goodsname=${goodsname}">默认</a>--%>
                    <%--<a href="search?type=${type}&goodsname=${goodsname}&ud=1" data-sort="price" class="active" data-sort-type="desc">价格</a>--%>
                <%--</c:if>--%>
            <%--</div>--%>
        <%--</div>--%>
        <div class="ui-good-list-box">
            <%--这里开始商品--%>
            <c:choose>
                <c:when test="${goodsList!=null&&goodsList.size>0}">
                    <c:forEach items="${goodsList}"  var="goods">
                        <%--<%--%>
                            <%--TypeService ts = new TypeServiceImpl();--%>
                            <%--Goods goods = (Goods) pageContext.getAttribute("goods");--%>
                            <%--Type type = ts.queryTypeById(goods.getType());--%>
                            <%--pageContext.setAttribute("tp",type);--%>
                        <%--%>--%>
                        <a class="ui-good-item"  href="goodsinfo.jsp?goodsid=${goods.id}">
                            <div class="cover-box">
                                <img src="${goods.img}">
                            </div>
                            <div class="info-box">
                                <h4>${goods.name}</h4>
                                <span class="price">${goods.price}</span>
                                <div class="tags-box">
                                    <span>信息</span>
                                </div>
                            </div>
                        </a>
                    </c:forEach>
                </div>
                    <%--<div class="ui-page">--%>
                        <%--<!-- <a href="" class="first"></a> -->--%>
                        <%--<a href="search?pageNum=${requestScope.pageModel.previousPageNo}&type=${type}&goodsname=${goodsname}&ud=${ud}" class="prev">上页</a>--%>
                        <%--<c:forEach items="${requestScope.pageModel.pages}" var="num">--%>
                            <%--<c:choose>--%>
                                <%--<c:when test="${num==requestScope.pageModel.pageNo}">--%>
                                    <%--<a href="#" class="active">${num}</a>--%>
                                <%--</c:when>--%>
                                <%--<c:otherwise>--%>
                                    <%--<a href="search?pageNum=${num}&type=${type}&goodsname=${goodsname}&ud=${ud}">${num}</a>--%>
                                <%--</c:otherwise>--%>
                            <%--</c:choose>--%>
                        <%--</c:forEach>--%>
                            <%--&lt;%&ndash;<span></span>&ndash;%&gt;--%>
                        <%--<a href="search?pageNum=${requestScope.pageModel.nextPageNo}&type=${type}&goodsname=${goodsname}&ud=${ud}" class="next">下页</a>--%>
                        <%--<!-- <a href="" class="end"></a> -->--%>
                    <%--</div>--%>
                </c:when>
                <c:otherwise>
                    <div class="func-error-box">
                        <h1 class="big">不存在该商品</h1>
                        <h1>抱歉，您要的我们给不了</h1>
                        <p>虽然这个商品不存在了，但其实您可以继续看看:</p>
                        <div class="ctrl-box">
                            <a href="index.jsp" class="btn min stroke">访问首页</a>
                            <a href="user.jsp" class="btn min stroke black">个人中心</a>
                        </div>
                    </div>
                </c:otherwise>
            </c:choose>


    </div>
<div id="page_end_html">
    <script src="https://cdn.jsdelivr.net/npm/live2d-widget@3.0.4/lib/L2Dwidget.min.js"></script>
    <script type="text/javascript">
        L2Dwidget.init();
    </script>
</div>
<%@include file="foot.jsp"%>
</body>
</html>

